#ifndef __EJ_BSP_UART__
#define __EJ_BSP_UART__

#include "common_def.h"

typedef enum
{
	EJ_UART_MODE_HW 	= 0x0,
	EJ_UART_MODE_SIM 	= 0x1,
}ej_uart_mode_e;

typedef struct 
{
	const uint8_t *name;
	uint32_t baud_rate;
	uint32_t tx_pin;
	uint32_t rx_pin;
	uint8_t *rx_buf;
	uint32_t rx_buf_size;
}uart_cfg_t;

typedef struct 
{
	const uart_cfg_t *cfg;
	ej_uart_mode_e mode;
	int uart_hw_hdl;
	bool uart_init_flag;
} bsp_uart_t;

/* ------For high-level code -------*/


/* ------ For low-level code ------------ */
bool ej_bsp_uart_init(bsp_uart_t *handle, const uart_cfg_t *cfg, 	ej_uart_mode_e mode);

uint32_t ej_bsp_uart_send_bytes(bsp_uart_t *handle, uint8_t *buf, uint32_t size);

uint32_t ej_bsp_uart_read_bytes(bsp_uart_t *handle, uint8_t *buf, uint32_t size);

#endif  /*__EJ_BSP_UART__*/
